﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="ExploradorEscandallos.aspx.vb" Inherits="Facody.ExploradorEscandallos" %>
<%@ Register src="controles/GridComponentes.ascx" tagname="GridComponentes" tagprefix="uc1" %>
<%@ Reference Control="controles/GridComponentes.ascx" %>
<asp:Content ID="Content2" ContentPlaceHolderID="PHMenu" runat="server">
    <asp:Button ID="btnEscandallos" runat="server" CssClass="botonmenu" 
        Text="Escandallos" />
&nbsp;
    <asp:Button ID="btnComponentes" runat="server" CssClass="botonmenu" 
        Text="Componentes" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PHPrincipal" runat="server">
    <asp:Panel ID="pnlEscandallos" runat="server" CssClass="tabla">
        <div  align="center">
            <table width="100%">
                <tr>
                    <td valign="top" align="left" width="250px">
                        <asp:TreeView ID="TVEscandallos" runat="server" NodeIndent="30" ExpandDepth="1">
                            <Nodes>
                                <asp:TreeNode Text="Biomasa" Value="B">
                                    <asp:TreeNode Text="Natur" Value="BN">
                                        <asp:TreeNode Text="Leña" Value="BNL">
                                            <asp:TreeNode Text="Normal" Value="BNLN"></asp:TreeNode>
                                            <asp:TreeNode Text="Contraria" Value="BNLC"></asp:TreeNode>
                                        </asp:TreeNode>
                                        <asp:TreeNode Text="Pellet" Value="BNP">
                                            <asp:TreeNode Text="Normal" Value="BNPN"></asp:TreeNode>
                                            <asp:TreeNode Text="Contraria" Value="BNPC"></asp:TreeNode>
                                        </asp:TreeNode>
                                        <asp:TreeNode Text="Mixta" Value="BNM">
                                            <asp:TreeNode Text="Normal" Value="BNMN"></asp:TreeNode>
                                            <asp:TreeNode Text="Contraria" Value="BNMC"></asp:TreeNode>
                                        </asp:TreeNode>
                                    </asp:TreeNode>
                                    <asp:TreeNode Text="Tuero" Value="BT">
                                        <asp:TreeNode Text="Normal" Value="BTN"></asp:TreeNode>
                                        <asp:TreeNode Text="Contraria" Value="BTC"></asp:TreeNode>
                                    </asp:TreeNode>
                                    <asp:TreeNode Text="XAR/XAP" Value="BX"></asp:TreeNode>
                                </asp:TreeNode>
                                <asp:TreeNode Text="Gasoil" Value="G"></asp:TreeNode>
                                <asp:TreeNode Text="Sinfines" Value="S">
                                    <asp:TreeNode Text="2m" Value="S2">
                                        <asp:TreeNode Text="Desmontable" Value="S2D">
                                            <asp:TreeNode Text="Salida D60" Value="S2D6">
                                                <asp:TreeNode Text="25W" Value="S2D62"></asp:TreeNode>
                                                <asp:TreeNode Text="40W" Value="S2D64"></asp:TreeNode>
                                                <asp:TreeNode Text="60W" Value="S2D66"></asp:TreeNode>
                                            </asp:TreeNode>
                                            <asp:TreeNode Text="Salida D70" Value="S2D7">
                                                <asp:TreeNode Text="25W" Value="S2D72"></asp:TreeNode>
                                                <asp:TreeNode Text="40W" Value="S2D74"></asp:TreeNode>
                                                <asp:TreeNode Text="60W" Value="S2D76"></asp:TreeNode>
                                            </asp:TreeNode>
                                        </asp:TreeNode>
                                        <asp:TreeNode Text="Entero" Value="S2E">
                                            <asp:TreeNode Text="Salida D60" Value="S2E6">
                                                <asp:TreeNode Text="25W" Value="S2E62"></asp:TreeNode>
                                                <asp:TreeNode Text="40W" Value="S2E64"></asp:TreeNode>
                                                <asp:TreeNode Text="60W" Value="S2E66"></asp:TreeNode>
                                            </asp:TreeNode>
                                            <asp:TreeNode Text="Salida D70" Value="S2E7">
                                                <asp:TreeNode Text="25W" Value="S2E72"></asp:TreeNode>
                                                <asp:TreeNode Text="40W" Value="S2E74"></asp:TreeNode>
                                                <asp:TreeNode Text="60W" Value="S2E76"></asp:TreeNode>
                                            </asp:TreeNode>
                                        </asp:TreeNode>
                                    </asp:TreeNode>
                                    <asp:TreeNode Text="1,5m" Value="S1">
                                        <asp:TreeNode Text="Desmontable" Value="S1D">
                                            <asp:TreeNode Text="Salida D60" Value="S1D6">
                                                <asp:TreeNode Text="25W" Value="S1D62"></asp:TreeNode>
                                                <asp:TreeNode Text="40W" Value="S1D64"></asp:TreeNode>
                                            </asp:TreeNode>
                                            <asp:TreeNode Text="Salida D70" Value="S1D7">
                                                <asp:TreeNode Text="25W" Value="S1D72"></asp:TreeNode>
                                                <asp:TreeNode Text="40W" Value="S1D74"></asp:TreeNode>
                                            </asp:TreeNode>
                                        </asp:TreeNode>
                                        <asp:TreeNode Text="Entero" Value="S1E">
                                            <asp:TreeNode Text="Salida D60" Value="S1E6">
                                                <asp:TreeNode Text="25W" Value="S1E62"></asp:TreeNode>
                                                <asp:TreeNode Text="40W" Value="S1E64"></asp:TreeNode>
                                            </asp:TreeNode>
                                            <asp:TreeNode Text="Salida D70" Value="S1E7">
                                                <asp:TreeNode Text="25W" Value="S1E72"></asp:TreeNode>
                                                <asp:TreeNode Text="40W" Value="S1E74"></asp:TreeNode>
                                            </asp:TreeNode>
                                        </asp:TreeNode>
                                    </asp:TreeNode>
                                </asp:TreeNode>
                                <asp:TreeNode Text="Tolvas" Value="T">
                                    <asp:TreeNode Text="200L" Value="T2"></asp:TreeNode>
                                    <asp:TreeNode Text="300L" Value="T3"></asp:TreeNode>
                                    <asp:TreeNode Text="400L" Value="T4"></asp:TreeNode>
                                </asp:TreeNode>
                                <asp:TreeNode Text="Quemadores" Value="Q"></asp:TreeNode>
                                <asp:TreeNode Text="Compensadores" Value="C"></asp:TreeNode>
                                <asp:TreeNode Text="Productores" Value="P"></asp:TreeNode>
                                <asp:TreeNode Text="Facsol" Value="F"></asp:TreeNode>
                            </Nodes>
                            <NodeStyle CssClass="boton" NodeSpacing="2px" Width="120px" />
                        </asp:TreeView>
                    </td>
                    <td valign="top" align="center">
                        <asp:GridView ID="GVEscandallos" runat="server" AutoGenerateColumns="False">
                            <Columns>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:HyperLink ID="LinkImagen" runat="server" ImageURL=<%# IconoImagen(Eval("AR_REF")) %> 
                                            Target="_blank" NavigateUrl=<%# "../VerImagen.aspx?CodArticulo=" & Eval("AR_REF") %>>HyperLink</asp:HyperLink>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="AR_REF" HeaderText="Código" />
                                <asp:BoundField DataField="AR_DESIGN" HeaderText="Escandallo" />
                                <asp:BoundField DataField="AS_QteSto" HeaderText="Stock">
                                <ItemStyle HorizontalAlign="Right" />
                                </asp:BoundField>
                                <asp:ButtonField CommandName="ver" Text="Ver" ButtonType="Image" 
                                    ImageUrl="~/img/IconoLupa.gif" />
                                <asp:ButtonField CommandName="autocad" Text="CAD" ButtonType="Image" 
                                    ImageUrl="~/img/IconoCAD.gif" />
                            </Columns>
                        </asp:GridView>
                    </td>
                </tr>
            </table>
        </div>
    </asp:Panel>
    <asp:Panel ID="pnlFabricacion" runat="server" Visible="False">
        <div align="center" class="divcontroles">
            <asp:Label ID="Label1" runat="server" CssClass="etititulo" Text="Simulación de fabricación"></asp:Label>
        </div>
        <div align="center">
            <table>
                <tr>
                    <td>
                        <asp:Label ID="Label3" runat="server" CssClass="etititulopeq" 
                            Text="Cantidad a simular:"></asp:Label>
                    </td>
                    <td align="left">
                        <asp:TextBox ID="txtCantidadFabricar" runat="server" Width="76px"></asp:TextBox>
                        <asp:RangeValidator ID="valCantidad" runat="server" 
                            ControlToValidate="txtCantidadFabricar" CssClass="etierror" 
                            ErrorMessage="La cantidad no es correcta" MaximumValue="999" MinimumValue="1"></asp:RangeValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td align="left">
                        <asp:Button ID="btnFabricar" runat="server" CssClass="boton" 
                            Text="Fabricar" />
                    </td>
                </tr>
            </table>
        </div>
    </asp:Panel>
    <asp:Panel ID="pnlDetalle" runat="server" Visible="False" >
        <div align="center">
            <div class="divcontroles">

                <table style="width: 100%">
                    <tr>
                        <td>
                            &nbsp;</td>
                        <td width="100%">
                <asp:Label ID="LblNombreEscandallo" runat="server" CssClass="etititulo"></asp:Label>
                <asp:Label ID="LblFabricacion" runat="server" CssClass="etititulopeq"></asp:Label>
                            </td>
                        <td>
                            <asp:Button ID="Simulacion" runat="server" CssClass="boton" Text="Simulación" />
                        </td>
                    </tr>
                </table>

            </div>

        </div>

        <div align="center">
            <asp:GridView ID="GVComponentes" runat="server" 
        AutoGenerateColumns="False">
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:HyperLink ID="LinkImagen" runat="server" ImageURL=<%# IconoImagen(Eval("AR_REF")) %> 
                                Target="_blank" 
                                NavigateUrl=<%# "VerImagen.aspx?CodArticulo=" & Eval("AR_REF") %>></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="AR_REF" HeaderText="Referencia" >
                    <ItemStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="AR_DESIGN" HeaderText="Descripción" >
                    <ItemStyle HorizontalAlign="Left" />
                    </asp:BoundField>
                    <asp:BoundField DataField="MEDIDAS" HeaderText="Medidas" />
                    <asp:BoundField DataField="NO_Qte" HeaderText="Esc." >
                    <ItemStyle HorizontalAlign="Right" />
                    </asp:BoundField>
                    <asp:BoundField DataField="AS_QteSto" DataFormatString="{0:###,##0.##}" 
                        HeaderText="Stock">
                    <ItemStyle HorizontalAlign="Right" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Fabricable" DataFormatString="{0:###,##0.##}" 
                        HeaderText="Max.">
                    <ItemStyle HorizontalAlign="Right" />
                    </asp:BoundField>
                    <asp:BoundField HeaderText="Total">
                    <HeaderStyle Wrap="True" />
                    <ItemStyle HorizontalAlign="Right" />
                    </asp:BoundField>
                    <asp:BoundField 
                        HeaderText="Fab.">
                    <ItemStyle HorizontalAlign="Right" />
                    </asp:BoundField>
                    <asp:BoundField HeaderText="" />
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:Image ID="imgVerEscandallo" runat="server" 
                                ImageUrl="~/img/expand_button.png" style="cursor: pointer"/>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Nivel" HeaderText="Nivel" />
                    <asp:BoundField DataField="PADRE" HeaderText="Padre" />
                    <asp:BoundField DataField="OMITIRENSIMULACION" 
                        HeaderText="Omitir en simulación" />
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:HyperLink ID="LinkCAD" runat="server" ImageURL="~/img/iconoCAD.gif" 
                                Target="_blank" 
                                NavigateUrl=<%# "VerAutocad.aspx?CodArticulo=" & Eval("AR_REF") %>></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
        <br />
        <br />
        <br />
    </asp:Panel>

</asp:Content>
